package com.fc.tms.filter;

import java.util.Date;

import com.fc.framework.annotation.FilterOperation;
import com.fc.framework.annotation.FilterOperation.Operation;
import com.fc.framework.filter.AbstractFilter;
import com.fc.tms.constant.Course;
import com.fc.tms.constant.Team;
import com.fc.tms.constant.UserType;

public class UserFilter extends AbstractFilter {

    private static final long serialVersionUID = 1872074929912038656L;

    private UserType userType;

    private Boolean isDimission;

    @FilterOperation(hql = " o.cnName like :cnNameLike ", operation = Operation.LIKE)
    private String cnNameLike;

    @FilterOperation(hql = " o.eName like :eNameLike ", operation = Operation.LIKE)
    private String eNameLike;

    @FilterOperation(hql = " NOT EXISTS (SELECT 1 FROM TrainingLog tl WHERE tl.studentId = o.id AND tl.course = :notTrainCourse) ")
    private Course notTrainCourse;

    @FilterOperation(hql = " ")
    private Team team;

    @FilterOperation(hql = " EXISTS (SELECT 1 FROM JobTransferLog jtl WHERE jtl.studentId = o.id AND jtl.transferDate >= :jobTransferAfter AND jtl.transferDate <= :jobTransferBefore AND jtl.team = :team) ")
    private Date jobTransferBefore;

    @FilterOperation(hql = " ")
    private Date jobTransferAfter;

    public String geteNameLike() {
        return eNameLike;
    }

    public void seteNameLike(String eNameLike) {
        this.eNameLike = eNameLike;
    }

    public Date getJobTransferAfter() {
        return jobTransferAfter;
    }

    public void setJobTransferAfter(Date jobTransferAfter) {
        this.jobTransferAfter = jobTransferAfter;
    }

    public String getCnNameLike() {
        return cnNameLike;
    }

    public void setCnNameLike(String cnNameLike) {
        this.cnNameLike = cnNameLike;
    }

    public UserType getUserType() {
        return userType;
    }

    public void setUserType(UserType userType) {
        this.userType = userType;
    }

    public Course getNotTrainCourse() {
        return notTrainCourse;
    }

    public void setNotTrainCourse(Course notTrainCourse) {
        this.notTrainCourse = notTrainCourse;
    }

    public Date getJobTransferBefore() {
        return jobTransferBefore;
    }

    public void setJobTransferBefore(Date jobTransferBefore) {
        this.jobTransferBefore = jobTransferBefore;
    }

    public Team getTeam() {
        return team;
    }

    public void setTeam(Team team) {
        this.team = team;
    }

    public Boolean getIsDimission() {
        return isDimission;
    }

    public void setIsDimission(Boolean isDimission) {
        this.isDimission = isDimission;
    }
}